package main.Q701_800;

public class Q741_750 {
    public static void main(String[] args) {
        System.out.println("Question741：");
        System.out.println("Question742：");
        System.out.println("Question743：");
        System.out.println("Question744：寻找比目标字母大的最小字母");
        System.out.println("Question745：");
        System.out.println("Question746：使用最小花费爬楼梯");
        System.out.println("Question747：");
        System.out.println("Question748：");
        System.out.println("Question749：");
        System.out.println("Question750：");
    }
}

class Question744{
    public char nextGreatestLetter(char[] letters, char target) {
        char result='*';
        for (int i=0;i<letters.length;i++){
            if (letters[i]>target){
                result=letters[i];
                break;
            }
        }
        if (result=='*') result=letters[0];
        return result;
    }
}

class Question746{
    public int minCostClimbingStairs(int[] cost) {
        int length=cost.length;//动态规划表
        int[] dp=new int[length];
        if (length==1) return cost[0];
        for (int i=0;i<length;i++){
            if (i==0||i==1) dp[i]=cost[i];
            else {
                dp[i]=Math.min(dp[i-1],dp[i-2])+cost[i];
            }
        }
        return Math.min(dp[length-1],dp[length-2]);
    }
}